package test3;

public class GirlfriendTest {
    public static void main(String[] args) {
        Girl arr[]=new Girl[4];

        Girl a=new Girl("小诗诗",17,"女","睡觉");
        Girl b=new Girl("小雅雅",18,"女","抽象");
        Girl c=new Girl("小灵灵",19,"女","玩游戏");
        Girl d=new Girl("小玉玉",20,"女","爱学习");
        arr[0]=a;
        arr[1]=b;
        arr[2]=c;
        arr[3]=d;
        int sum =0;
        for (int i = 0; i < arr.length; i++) {
            sum=sum+arr[i].getAge();
        }
   int avg = sum/arr.length;
        int count =0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i].getAge()<avg){
                System.out.println(arr[i].getName()+","+arr[i].getAge()+","+arr[i].getGender()+","+arr[i].getHobby());
            }

        }
        System.out.println("有"+count+"个");
    }
}
